﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Testing.Test
{
    [TestClass]
    public class UnitTest1
    {
        //[TestMethod]
        //public void TestIsBuzzingNow()
        //{
        //    // Arrange
        //    var alarm = new Alarm(DateTime.Now);
            
        //    // Act
        //    var isBuzzing = alarm.IsBuzzing();

        //    // Assert
        //    Assert.IsTrue( isBuzzing );
        //}

        //[TestMethod]
        //public void TestIsBuzzing30Seconds()
        //{
        //    // Arrange
        //    var alarm = new Alarm(DateTime.Now.Subtract(new TimeSpan(0,29,0)));

        //    // Act
        //    var isBuzzing = alarm.IsBuzzing();

        //    // Assert
        //    Assert.IsTrue(! isBuzzing);
        //}


        [TestMethod]
        public void TestIsBuzzingAtMidnight()
        {
            // Arrange
            var midnight = new DateTime(2000, 1, 1, 0, 0, 0);
            var clock = new TestClock();
            clock.CurrentTime = midnight;

            var alarm = new Alarm(midnight, clock);

            // Act
            var isBuzzing = alarm.IsBuzzing();

            // Assert
            Assert.IsTrue(isBuzzing);
        }

    }
}
